package com.bootdo.common.utils;

import com.alibaba.fastjson.JSONObject;
import com.bootdo.oa.config.WebSocket;
import java.util.*;

public class WebSocketUtil {
    public static void sendDeviceMessage(WebSocket webSocket,String type,  String msg) throws InterruptedException {
        Map<String, Object> map = new HashMap<>();
        map.put("type", type);
        map.put("msg", msg);
        JSONObject json = new JSONObject(map);
        webSocket.sendMessage(json.toString());
    }

}
